Convolutinal Neural Network for Classifying Cars

Background

Stanford AI has developed a dataset of cars with make, model and year. The aim of this project is to classify cars as accurately as possible using a convolutional neural network. We will use the Keras package with Tensorflow backend to run model training, and we will validate and evaluate the accuracy of the model based on the parameters.

Model Aim: Classify a car as part of the 196 classes in the dataset in terms of both make and model year.

Contents

  1. Exploratory Data Analysis
  2. Build the Classifier
  3. Test Model on a Single Image
  4. Evaluate Model

Improving:https://github.com/CihanBosnali/Real-Time-Cars-Classification-Using-Keras/blob/master/model_trainer.py

Load packages

1. Exploratory Data Analysis

View Sample Images from Dataset

Summary Statistics

Count number of images for each car manufacturer

Lets visualize the distribution of the number of images for each car make & model

2. Build the Classifier

We will use 3 convolution layers for the sake of computing power, with all layers using the relu activation function. We use this function because of it's non-linear (compared to sigmoid, for example, which can cause neurons to 'vanish').

Saving model to disk

Keep a record of this model for future reference

3. Test Model on a Single Image

Loading Model from disk

Load single prediction image

Make Prediction

4. Evaluate Accuracy of Results

Read the results

Training vs Validation accuracy